package com.css.fxfzysx.modules.ysxManagement.controller;

import com.css.fxfzysx.base.response.RestResponse;
import com.css.fxfzysx.modules.ysxManagement.service.DiBoundService;
import com.css.fxfzysx.modules.ysxManagement.vo.DiBoundVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 震害等级对应的震害指数的中值和上下限
 */
@RestController
@RequestMapping("diBound")
public class DiBoundController {

    @Autowired
    private DiBoundService diBoundService;

    /**
     * 震害等级对应的震害指数的中值和上下限添加或修改
     *
     * @return
     */
    @PostMapping("/saveOrUpdateDiBound")
    public RestResponse saveOrUpdateDiBound(@RequestBody DiBoundVo diBoundVo) {
        return diBoundService.saveOrUpdateDiBound(diBoundVo);
    }

    /**
     * 震害等级对应的震害指数的中值和上下限查询
     */
    @GetMapping("getAllDiBound")
    public RestResponse getAllDiBound(String titleName) {
        return diBoundService.getAllDiBound(titleName);
    }

    /**
     * 震害等级对应的震害指数的中值和上下限删除
     */
    @GetMapping("deleteDiBoundById")
    public RestResponse deleteDiBoundById(String diBoundIds,String arrangeIds) {
        return diBoundService.deleteDiBoundById(diBoundIds,arrangeIds);
    }
}
